#import "ChordString.h"

@implementation ChordString

- (id)init
{
	if(!self) {
		self = [super init];
	}
	// NSLog([NSString stringWithFormat:@"%@/resources/ChordsDict.plist", [[NSBundle mainBundle] bundlePath]]);
	chordsDict = [[NSDictionary dictionaryWithContentsOfFile: [NSString stringWithFormat:@"%@/resources/ChordsDict.plist", [[NSBundle mainBundle] bundlePath]]] retain];
	
	return self;
}


- (void)setChord:(NSString *)myChord
{
	myChord = [myChord copy];
	[chord release];
	chord = myChord;
}

- (void)setMode:(NSString *)myMode
{
	myMode = [myMode copy];
	[mode release];
	mode = myMode;
}

- (NSString *)getChordPosition
{
	NSString *combination=[NSString stringWithFormat:@"%@-%@", chord ,mode];
	NSLog([NSString stringWithFormat: @"CHORD-MODE: <%@>", combination]);
	position=[chordsDict objectForKey:combination];
	NSLog([NSString stringWithFormat: @"CHORD-POSITION: %@", position]);
	return position;
}

@end